package com.zmhc.product.service.impl;

import java.util.List;
import com.zmhc.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zmhc.product.mapper.CategorySpecificationMapper;
import com.zmhc.product.domain.CategorySpecification;
import com.zmhc.product.service.ICategorySpecificationService;

/**
 * 商品分类规格Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-11
 */
@Service
public class CategorySpecificationServiceImpl implements ICategorySpecificationService 
{
    @Autowired
    private CategorySpecificationMapper categorySpecificationMapper;

    /**
     * 查询商品分类规格
     * 
     * @param id 商品分类规格主键
     * @return 商品分类规格
     */
    @Override
    public CategorySpecification selectCategorySpecificationById(Long id)
    {
        return categorySpecificationMapper.selectCategorySpecificationById(id);
    }

    /**
     * 查询商品分类规格列表
     * 
     * @param categorySpecification 商品分类规格
     * @return 商品分类规格
     */
    @Override
    public List<CategorySpecification> selectCategorySpecificationList(CategorySpecification categorySpecification)
    {
        return categorySpecificationMapper.selectCategorySpecificationList(categorySpecification);
    }

    /**
     * 新增商品分类规格
     * 
     * @param categorySpecification 商品分类规格
     * @return 结果
     */
    @Override
    public int insertCategorySpecification(CategorySpecification categorySpecification)
    {
        categorySpecification.setCreateTime(DateUtils.getNowDate());
        return categorySpecificationMapper.insertCategorySpecification(categorySpecification);
    }

    /**
     * 修改商品分类规格
     * 
     * @param categorySpecification 商品分类规格
     * @return 结果
     */
    @Override
    public int updateCategorySpecification(CategorySpecification categorySpecification)
    {
        categorySpecification.setUpdateTime(DateUtils.getNowDate());
        return categorySpecificationMapper.updateCategorySpecification(categorySpecification);
    }

    /**
     * 批量删除商品分类规格
     * 
     * @param ids 需要删除的商品分类规格主键
     * @return 结果
     */
    @Override
    public int deleteCategorySpecificationByIds(Long[] ids)
    {
        return categorySpecificationMapper.deleteCategorySpecificationByIds(ids);
    }

    /**
     * 删除商品分类规格信息
     * 
     * @param id 商品分类规格主键
     * @return 结果
     */
    @Override
    public int deleteCategorySpecificationById(Long id)
    {
        return categorySpecificationMapper.deleteCategorySpecificationById(id);
    }
}
